package com.cheng.sell.utils;

import java.util.Random;

/**
 * <p>
 * Description:
 * </p>
 *
 * @author chengxintao
 * @version 1.0
 * <p>
 * <p>
 * History:
 * <p>
 * Date                 Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2018/8/25         chengxintao          1.0         To create
 * </p>
 * @see
 * @since
 */
public class KeyUtil {

    /**
     * 生成唯一主键
     * 时间戳加随机数
     * @return
     */
    public static synchronized String getUniqueKey() {
        Random random = new Random();
        Integer num = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + String.valueOf(num);
    }
}
